package cqrtplm.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;

@Data
public class CadDrawingDataDTO {
    @ExcelProperty("序号")
    private Integer id;

    @ExcelProperty("编码")
    private String code;

    @ExcelProperty("名称")
    private String name;

    @ExcelProperty("类型")
    private String type;

    @ExcelProperty("文档状态")
    private String documentStatus;

    @ExcelProperty("G/Z/P标识")
    private String gzpFlag;

    @ExcelProperty("产品线")
    private String productLine;

    @ExcelProperty("开发令")
    private String developmentOrder;

    @ExcelProperty("机型号")
    private String modelNumber;

    @ExcelProperty("图样号")
    private String drawingNumber;

    @ExcelProperty("是否是生产图纸")
    private Boolean isProductionDrawing;

    @ExcelProperty("图纸版本")
    private String drawingVersion;

    @ExcelProperty("指定供应商")
    private String designatedSupplier;

    @ExcelProperty("文件路径")
    private String filePath;


    public static CadDrawingDataDTO convertToCadDrawingDataDTO(ImportDocumentDTO importDocDTO) {
        CadDrawingDataDTO cadDrawingDataDTO = new CadDrawingDataDTO();
        cadDrawingDataDTO.setCode(importDocDTO.getDocumentName()+"."+importDocDTO.getDocumentFormat());
        cadDrawingDataDTO.setName(importDocDTO.getDocumentName());
        cadDrawingDataDTO.setType(importDocDTO.getDocumentType());
        cadDrawingDataDTO.setDocumentStatus(importDocDTO.getDocumentStatus());
        cadDrawingDataDTO.setGzpFlag("");
        cadDrawingDataDTO.setProductLine(importDocDTO.getProductLine());
        cadDrawingDataDTO.setDevelopmentOrder(importDocDTO.getProjectOrder());
        cadDrawingDataDTO.setModelNumber(importDocDTO.getMachineModel());
        cadDrawingDataDTO.setDrawingNumber(importDocDTO.getDrawingNumber());
        cadDrawingDataDTO.setIsProductionDrawing(importDocDTO.getIsProductionDrawing());
        cadDrawingDataDTO.setDrawingVersion(importDocDTO.getDrawingVersion());
        cadDrawingDataDTO.setDesignatedSupplier(importDocDTO.getDesignatedSupplier());
        cadDrawingDataDTO.setFilePath(importDocDTO.getFilePath());
        return cadDrawingDataDTO;
    }
}
